package org.gwu.seuss.admin.commandline;

import org.gwu.seuss.communication.util.PasswordPrompt;
import org.gwu.seuss.ui.commandline.BaseCommandLineArgs;
import org.kohsuke.args4j.Option;

public class AdministratorCommandLineArgs extends BaseCommandLineArgs {

	@Option(name = "-nu", usage = "new user login")
	private String newLoginName;

	@Option(name = "-np", usage = "new user password")
	private boolean newPassword = false;

	@Option(name = "-du", aliases = "-disable", usage = "disable user")
	private String disableUsername;

	@Option(name = "-eu", aliases = "-enable", usage = "enable user")
	private String enableUsername;

	@Option(name = "-ru", aliases = "-remove", usage = "remove user")
	private String removeUsername;

	private char[] retrievedPassword = null;
	
	public String getRemoveUsername() {
		return removeUsername;
	}

	public void setRemoveUsername(String removeUsername) {
		this.removeUsername = removeUsername;
	}

	public String getDisableUsername() {
		return disableUsername;
	}

	public void setDisableUsername(String disableUsername) {
		this.disableUsername = disableUsername;
	}

	public String getEnableUsername() {
		return enableUsername;
	}

	public void setEnableUsername(String enableUsername) {
		this.enableUsername = enableUsername;
	}

	public String getNewLoginName() {
		return newLoginName;
	}

	public void setLoginName(String loginName) {
		this.newLoginName = loginName;
	}

	public boolean isSetNewPassword() {
		return newPassword;
	}

	public void canSetNewPassword(boolean newPassword) {
		this.newPassword = newPassword;
	}
	
	public char[] retrievePassword(){
		
		if(retrievedPassword == null){
			retrievedPassword = PasswordPrompt.askForPassword("Please enter new password");
		}
		return retrievedPassword;
	}
	

}
